/**
 * 登录路由组件
 */
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import { Statistic, Row, Col, Form, Input, Button, Checkbox, Card, Carousel ,Image,message} from 'antd';
import { ArrowUpOutlined, ArrowDownOutlined } from '@ant-design/icons';
import './login.less'
import loginIcon from './imges/login.png'
import passIcon from './imges/pass.png'
import baIcon from './imges/ba.png'
import {post,get} from '../../untils/request'
import axios from 'axios';

const layout = {
    labelCol: { span: 3 },
    wrapperCol: { span: 16 },
};
const tailLayout = {
    wrapperCol: { offset: 3, span: 16 },
};
var sectionStyle = {
    // makesure here is String确保这里是一个字符串，以下是es6写法
    backgroundImage: `url(${baIcon})`
};
export default class Login extends Component {

    onFinish = async values => {

        get('/api/User/6b0cbbe4-779c-4074-972b-c34e52a15588').then(response=>{
            console.log(response)
        }).then(error=>{
            console.error(error);
        })
        return
       var requst= await get('/api/User/6b0cbbe4-779c-4074-972b-c34e52a15588',)
        console.log('Success:', requst);
        message.loading('Success:')
    };

    onFinishFailed = errorInfo => {
        console.log('Failed:', errorInfo);
    };
    render() {
        return (
            <div className="bg active" style={sectionStyle}>
                <div className="login-card card-active">
                    <div className="rotate change">
                        <div className="card-front">
                            <h4>登录</h4>
                            <div className="img_nav"><i class="top_nav"></i></div>
                            <Form
                                onFinishFailed={this.onFinishFailed}
                                onFinish={this.onFinish}
                            >
                                <Form.Item
                                    name="username"
                                    className="form-group"
                                    rules={[
                                        {
                                            required: true,
                                            message: 'Please input your username!',
                                        },
                                    ]}
                                >
                                    <Input className="form-style" placeholder="请输入用户名" />
                                </Form.Item>
                                <Form.Item
                                    name="password"
                                    className="form-group"
                                    rules={[
                                        {
                                            required: true,
                                            message: 'Please input your password!',
                                        },
                                    ]}
                                >
                                    <Input.Password className="form-style" placeholder="请输入密码" />
                                </Form.Item>
                                {/* <div className="form-group">
                                    <img className="input-icon" src={loginIcon}></img>
                                    <input type="text" class="form-style" placeholder="请输入用户名"></input>
                                </div>
                                <div className="form-group">
                                    <input type="password" class="form-style" placeholder="请输入密码"></input>
                                </div> */}
                                <div className="form-group">
                                    <Button type="primary" htmlType="submit" className="input-btn">
                                        登录
                                </Button>
                                </div>
                            </Form>

                        </div>

                    </div>
                </div>
            </div>
        );
    }



}